https://leetcode.cn/problems/valid-palindrome/submissions/527834694/

class Solution {
public:
    bool isNumber(char& x)
    {
        return (x >= 'a' && x <= 'z')
            || (x >= '0' && x <= '9');
    }
    bool isPalindrome(string s) {
        for (char& e : s)
        {
            if (e >= 'A' && e <= 'Z') e = e + 32;
        }
        int left = 0, right = s.size() - 1;
        while (left < right)
        {
            while (left < right && (!isNumber(s[left]))) left++;
            while (left < right && (!isNumber(s[right]))) right--;
            if (s[left] != s[right]) return false;
            left++;
            right--;

        }
        return true;

    }
};